import gym

# 创建 CartPole-v1 环境实例
env = gym.make('CartPole-v1')
# 重置环境
state = env.reset()
# 执行动作
next_state, reward, terminated, truncated, info = env.step(0)
print(next_state, reward, terminated, truncated)